package com.wehealth;

import java.util.ArrayList;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class DepartAdapter extends BaseAdapter{
	
	private LayoutInflater mInflater;
	
	private String[]  mDeparts;

	
	public DepartAdapter(Context context, String[] departs){
		mDeparts = departs;
		mInflater = LayoutInflater.from(context); 
		
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mDeparts.length;
	}

	@Override
	public Object getItem(int pos) {
		// TODO Auto-generated method stub
		return pos;
	}

	@Override
	public long getItemId(int pos) {
		// TODO Auto-generated method stub
		return pos;
	}

	@Override
	public View getView(int pos, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		View view = mInflater.inflate(R.layout.depart_list_item, null);
		TextView titleView = (TextView) view.findViewById(R.id.depart_name);
		final String item =mDeparts[pos];
		titleView.setText(item);
		return view;
	}

}
